# -*-coding:utf-8 -*-

from schedule.models import *
from rest_framework import serializers
from core.api.serializers import DynamicFieldsSerializerMixin


class WatchDutySerializer(DynamicFieldsSerializerMixin, serializers.ModelSerializer):
    __str__ = serializers.CharField(read_only=True)
    department_name = serializers.URLField(source='get_department_name', read_only=True)
    who_name = serializers.URLField(source='get_who_name', read_only=True)
    thumbnail = serializers.URLField(source='get_who_thumbnai100x100', read_only=True)

    class Meta:
        model = WatchDuty
        fields = '__all__'


class WhereToSerializer(DynamicFieldsSerializerMixin, serializers.ModelSerializer):
    __str__ = serializers.CharField(read_only=True)
    department_name = serializers.URLField(source='get_department_name', read_only=True)
    who_name = serializers.URLField(source='get_who_name', read_only=True)
    thumbnail = serializers.URLField(source='get_who_thumbnai100x100', read_only=True)

    class Meta:
        model = WhereTo
        fields = '__all__'
